#import "./iteration_issues_with_labels.fragment.graphql"

query IterationIssuesWithLabelFilter(
  $fullPath: ID!
  $id: ID!
  $isGroup: Boolean = true
  $labelName: [String]
  $beforeCursor: String = ""
  $afterCursor: String = ""
  $firstPageSize: Int
  $lastPageSize: Int
) {
  group(fullPath: $fullPath) @include(if: $isGroup) {
    id
    issues(
      iterationId: [$id]
      labelName: $labelName
      before: $beforeCursor
      after: $afterCursor
      first: $firstPageSize
      last: $lastPageSize
      includeSubgroups: true
    ) {
      ...IterationIssuesWithLabels
    }
  }
  project(fullPath: $fullPath) @skip(if: $isGroup) {
    id
    issues(
      iterationId: [$id]
      labelName: $labelName
      before: $beforeCursor
      after: $afterCursor
      first: $firstPageSize
      last: $lastPageSize
    ) {
      ...IterationIssuesWithLabels
    }
  }
}
